---
id: "expression-deprecated-decorator"
keywords: ["deprecated", "decorator"]
name: "@deprecated"
summary: "This is the `@deprecated` decorator."
category: "decorators"
---

The `@deprecated` decorator is used to add deprecation notes to types, values and submodules. The compiler and editor tooling will yield a warning whenever a deprecated entity is being used.

Alternatively, use the `@@deprecated` decorator to add a deprecation warning to the file level.

### Examples

<CodeTab labels={["ReScript", "JS Output"]}>

```res
@deprecated
type person = {id: int, name: string}

@deprecated
let customDouble = n => n * 2

@deprecated("Use OtherModule.customTriple instead")
let customTriple = n => n * 3

@deprecated("Use OtherModule instead")
module MyModule = {
  type t
}
```

```js
function customDouble(n) {
  return n << 1;
}

function customTriple(n) {
  return Math.imul(n, 3);
}

var MyModule = {};
```

</CodeTab>
